package com.control.qct.businesssteward.adapter;

import android.support.annotation.Nullable;

import com.control.qct.businesssteward.R;
import com.control.qct.businesssteward.model.PaymentStyleModel;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/12/3 0003.
 */

public class PaymentStyleAdapter extends BaseQuickAdapter<PaymentStyleModel, BaseViewHolder> {
    public PaymentStyleAdapter(@Nullable List<PaymentStyleModel> data) {
        super(R.layout.rv_pay_style_item, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, PaymentStyleModel item) {
        holder.setText(R.id.tv_pay_style_name, item.getTitle());
        switch (item.getGroupNo()) {
            case 1://现金
                holder.setImageResource(R.id.iv_pay_style,R.drawable.icon_jiesuan_xianjin);
                break;
            case 2://支付宝
                holder.setImageResource(R.id.iv_pay_style,R.drawable.icon_jiesuan_zhifubao);
                break;
            case 3://储值卡
                holder.setImageResource(R.id.iv_pay_style,R.drawable.icon_jiesuan_chuzhika);
                break;
            case 4://智能码
                holder.setImageResource(R.id.iv_pay_style,R.drawable.icon_shouyintai_yimafu);
                break;
            case 5://抵用券
                holder.setImageResource(R.id.iv_pay_style,R.drawable.icon_jiesuan_diyongquan);
                break;
            case 6://微信
                holder.setImageResource(R.id.iv_pay_style,R.drawable.icon_jiesuan_weixin);
                break;
            case 7://购物卡
                holder.setImageResource(R.id.iv_pay_style,R.drawable.icon_jiesuan_gouwuka);
                break;
            case 8://云闪付
                holder.setImageResource(R.id.iv_pay_style,R.drawable.icon_jiesuan_yunshanfu);
                break;
            case 9://积分抵扣
                holder.setImageResource(R.id.iv_pay_style,R.drawable.icon_jiesuan_jifen);
                break;
        }
    }
}
